﻿using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Configuration;

namespace ABC.Tech
{
    public static class Tech 
    {
        /// <summary>
        /// Method used to get list of all tech Initials 
        /// </summary>
        /// <returns></returns>
        public static List<string> getListOfTechInitials()
        {
            List<string> _list = new List<string>();
            string sqlstring = "select INITIALS from tabWORKERS where ACTIVE = true";
           // using (OleDbConnection connection = new OleDbConnection(ConfigurationManager.ConnectionStrings["db"].ConnectionString))
            {
                try
                {
                    //connection.Open();
                    OleDbCommand command = new OleDbCommand(sqlstring, ABC.Database.DataBaseConnection.MyConn);
                   // OleDbCommand command = new OleDbCommand(sqlstring, connection);
                    OleDbDataReader aReader = command.ExecuteReader();
                    _list.Add("*");
                    while (aReader.Read())
                    {
                        _list.Add(aReader[0].ToString());
                    } 
                }
                catch (Exception )
                {               
                    throw;
                }
            }
            return _list;         
        }
    }

   
}
